<template>
	<view>
		<u-navbar title="添加工作经历" rightText="保存" placeholder="true" @rightClick="into" :autoBack="true">
		</u-navbar>
		<view>
			<view>
				<h3 class="h">基础信息</h3>
				<view>
					<view class="txt"><text class="red">*</text><text class="tet">院校</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.corporate"></u--input>
				</view>
				<view>
					<view class="txt"><text class="red">*</text><text class="tet">学历</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.position"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">专业</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.workhours"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">开始时间</text></view>
					<uni-datetime-picker class="shuru1" type="date" v-model="data.entrytime" :clear-icon="false"
						@maskClick="maskClick" />
				</view>
				<view>
					<view class="txt"><text class="tet">结束时间</text></view>
					<uni-datetime-picker class="shuru1" type="date" v-model="data.departuretime" :clear-icon="false"
						@maskClick="maskClick" />
					<!-- <u--input
						type="date"
						class="shuru"
					    placeholder="请输入"
					    border="surround"
					    v-model="data.birthday"
					  ></u--input> -->
				</view>
				<view>
					<view class="txt"><text class="tet">是否取得学位</text></view>
					<radio-group @change="radioChange" class="shuru1">
						<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in label" :key="item.value">
							<radio :value="item.value" :checked="item.checked" /><span>{{item.label}}</span>
						</label>
					</radio-group>
				</view>

				<view>
					<view class="txt"><text class="tet">备注</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.remarks"></u--input>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				label: [{
					label: "是",
					value: 1,
					checked: true
				}, {
					label: "否",
					value: 0
				}],
				data: {
					colleges: "",
					education: "",
					major: "",
					starttime: "",
					overtime: "",
					academic: "",
					picture: "",
					remarks: "",
					userId: ""
				}
			}
		},
		onLoad(options) {
			this.data.userId = options.jid
			console.log(this.data.jid)
		},
		methods: {
			radioChange(e) {
				this.data.label = this.radio = e.detail.value
			},
			confirm(e) {
				console.log(e);
				this.data.birthday = e;
				this.show2 = false
			},
			open() {
				// console.log('open');
			},
			close() {
				this.show = false
				// console.log('close');
			},
			into() {
				console.log(this.data),
					this.$request({
						url: 'entry/ruzhi/jiaoyu',
						data: this.data,
						method: 'post',
						success: (res) => {
							this.review(),
								this.value = ""
						}

					})
					uni.navigateTo({
						url:'./tianjiaruzhi?jId='+this.data.userId-1
					})	
			},

		}
	}
</script>
<style>
	.red {
		color: red;
	}

	.shuru {
		margin-top: 30rpx;
		height: 20px;
		float: left;
		width: 72%;
	}

	.txt {
		margin-left: 20rpx;
		margin-top: 30rpx;
		float: left;
		width: 17%;
	}

	.h {
		margin-left: 25rpx;
	}

	.danyuan {
		margin-top: 20rpx;
		float: left;
		width: 100%;
	}

	.tet {
		color: #74777a;
	}

	.shuru1 {
		margin-top: 30rpx;
		float: left;
		width: 80%;
	}
</style>
